// This is the main DLL file.

#include "stdafx.h"
#include "SampleCPPLibrary.h"
using namespace SampleCPPLibrary;

ManagedSampleCPPWrapper::ManagedSampleCPPWrapper(void)
{
	this->NATIVE = new NativeSampleCPP();
};

ManagedSampleCPPWrapper::~ManagedSampleCPPWrapper(void)
{
	delete this->NATIVE;
};

array<uint8_t>^ ManagedSampleCPPWrapper::getData()
{
	// Get the original array from our code
	uint8_t* origArr = this->NATIVE->getData();

	// Creates a managed byte array by copying values
	array<uint8_t>^ retArr = gcnew array<uint8_t>(4);

	for(int i = 0; i < 4; i++)
		retArr[i] = origArr[i];

	return retArr;
};

uint32_t ManagedSampleCPPWrapper::getDataAsInt()
{
	return this->NATIVE->getDataAsInt();
};